package org.longgang.dao;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.longgang.bean.CompanyInfo;
import org.springframework.stereotype.Repository;

/**
 * CompanyInfoDAO继承基类
 */
@Repository
@Mapper
public interface CompanyInfoDAO extends MyBatisBaseDao<CompanyInfo, Integer> {
	
	@Select({"select * from company_info limit #{page},#{pages}"})
	List<CompanyInfo> getAllCompanyInfo(Integer page,Integer pages);
	
	@Insert({"insert into company_info(infoid) values(#{infoid})"})
	Integer insertCompanyInfo(CompanyInfo info);
	
	@Update({ "update company_info set companyname=#{companyname},com=#{com},city=#{city},industry=#{industry},contact=#{contact},sex=#{sex},phone=#{phone},companyintroduction=#{companyintroduction} where infoid=#{infoid}" })
	Integer updateCompanyInfo(CompanyInfo info);
	
	@Select({ "select * from company_info where infoid= #{infoid}" })
	CompanyInfo selectCompanyInfoById(CompanyInfo info);
}